home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 128 #32 / q32side2.d64 / t.klondike jones < prev    next >
Text File  |  2022-08-30  |  10KB  |  204 lines

  1.  
  2.  
  3.                         K L O N D I K E   J O N E S
  4.  
  5.                  Program by Fender Tucker and Maurice Jones
  6.  
  7.                            Text by Fender Tucker
  8.  
  9.  
  10.     There's no copyright notice on KLONDIKE JONES because I have decided to
  11. release this program into the public domain.  I hope you will make copies
  12. of the program and its associated files and spread them far and wide, so
  13. that every C-128 user will now have a modern-looking, mouse-driven Klondike
  14. solitaire game just like all of the Windows people do.
  15.  
  16.     The two main tools used in the program, Jon Mattson's CONTROL80-C and
  17. Maurice Randall's MOUSE80, were commissioned by LOADSTAR 128 and are
  18. supplied with complete documentation, with the hopes that you 128
  19. programmers out there will be inspired to use them to make more solitaire
  20. card games for the 80-column screen.  I WANT you to use the tools.  All I
  21. ask is that you mention in your program that you got them from LOADSTAR
  22. 128.
  23.  
  24.      This program REQUIRES a proportional mouse in Port #1.  There is no
  25. keyboard or joystick control.  If someone wants to add them, it's fine with
  26. me.  In fact, if you do a good job, send it to me and I'll put it on a
  27. future LS 128.
  28.  
  29.  
  30.  FINALLY, KLONDIKE JONES
  31.  -----------------------
  32.  
  33.     The solitaire is straight Klondike, with very few bells and whistles.
  34. You must have a mouse in Port #1 to use the program.  When you boot the
  35. program a hand will be dealt and you will be asked for your name.  Once you
  36. enter it, a file with a "kj." prefix will be kept on the disk with your
  37. scores in it.  If you want to change names, QUIT the program and run it
  38. again.  If you want to keep the same name but clear the scores, scratch the
  39. "kj." file.  You are only asked for your name once, at the beginning of the
  40. program.
  41.  
  42.     Once the game has started, move the pointer to the card you want to
  43. move and press the left button.  You'll hear a "ding" and the pointer will
  44. change to a box.  Then move the pointer to where you want to move the card
  45. to and press the left button again.  If the card can move, it will be
  46. moved, and if not, you'll hear a buzzer.
  47.  
  48.     Is there anyone who DOESN'T know how to play KLONDIKE solitaire?  The
  49. tableaux are dealt with an increasing number of cards dealt face down in
  50. the seven tableau piles, then covered with one face up card each.  The
  51. foundations, which are to be built from ace to king according to suit, are
  52. at the top right-center of the screen.  The deck is at the top left with
  53. the waste pile to its immediate right.  The tableaux are to be built DOWN
  54. in alternately colored suits.
  55.  
  56.     You may move a card from waste to tableau, waste to foundation, tableau
  57. to foundation or tableau to tableau.  An empty tableau pile may only be
  58. filled with a king.  You must move a whole tableau column; you cannot move
  59. just one or some of the face-up cards.  If you move all of the cards to the
  60. foundations, you win.
  61.  
  62.     You can double click on a tableau or waste pile to play the card to the
  63. foundation.
  64.  
  65.     Another thing you might want to change is line 1824.  If you take out
  66. the REM in that line it will cause the program to show you how many down
  67. cards are in each tableau pile.  It's not pretty, but it might be something
  68. you like.
  69.  
  70.  
  71.  OPTIONS
  72.  -------
  73.  
  74.     KLONDIKE JONES has some buttons at the top of the screen.  Here's what
  75. they do:
  76.  
  77.  DEAL - Click on this when the game is lost and your score will be updated
  78. (on disk, so leave the disk in the drive) and a new game will be dealt.
  79.  
  80.  YOUR SCORES - Click on this to see your cumulative scores.  You'll see the
  81. current game's score, total number of games, total number of wins, and the
  82. average number of cards played to the foundation per game.  Try for an
  83. average of 13 or more.
  84.  
  85.  CLAIM WIN - Click on this when you are sure that you have the game won but
  86. don't feel like moving all of the cards to the foundations. You'll get
  87. credit for 52 cards played.  This will only work if you've got all of the
  88. tableau cards showing.  Even if only one tableau card is still face-down,
  89. the CLAIM won't work.
  90.  
  91.  INFO - Click here to see a message from me proclaiming this program in the
  92. public domain and challenging 128 programmers to use the tools to create
  93. more solitaire games like this one.
  94.  
  95.  TURN 1 - Click here to change the game so that one card at a time is dealt
  96. from the deck, rather than the default three.  The button will change to
  97. TURN 3, which will return you back to flipping three cards if you click on
  98. it.  In other words, the button reflects the mode you can change to, not
  99. the current mode in force.
  100.  
  101.  QUIT - Click here, and if there's a LOADSTAR 128 disk in the drive,
  102. LOADSTAR 128 will be booted.  Otherwise, the program puts you back in
  103. BASIC.
  104.  
  105.  
  106.  TIPS FOR PROGRAMMING WITH CONTROL80-C WITH MOUSE80
  107.  --------------------------------------------------
  108.  
  109.     Print out the docs files for both of the tools and keep them for
  110. reference.  You don't need to use all of the commands, POKEs and SYSes that
  111. are available but there are some that you will undoubtedly need.
  112.  
  113.     I recommend using lines 10 through 120 just as they are in KLONDIKE
  114. JONES.  These lines load the tools and sets up the colors and fonts, and
  115. initializes the mouse (restricting its movement to the size of the
  116. screen).
  117.  
  118.     I used the logic from Maurice Jones' OUR OWN KLONDIKE (from LS #120)
  119. and then modified it to work on the 80-column screen and with the mouse.
  120. You may want to simply use the code for KLONDIKE JONES and get rid of the
  121. routines that aren't needed for your particular program.  Here are some
  122. that are very handy.  You can probably improve upon these if you try.
  123.  
  124.  Lines 600-630: The Button Definer - Here, in a two-dimensional array
  125. p(i,j), the boundaries of each clickable area is read from DATA statements.
  126. Each "button" has four parameters (or pieces of information): top left x
  127. coordinate, top left y coordinate, bottom right x coordinate, bottom right
  128. y coordinate.  The cards are 8x6 character rectangles but I made the second
  129. y coordinate for the tableau piles larger so that you can click anywhere on
  130. a pile (even below it) and the program will recognize the correct pile. The
  131. options button (the top line of the screen) have 0 for both y coordinates,
  132. indicating that those buttons are only one row tall.
  133.  
  134.  Lines 1840-1858: The Mouse Get Loop -
  135.  
  136.    1840 sysmo+9
  137.    1842 sysmo+15
  138.    1850 xm=peek(mo+35):ym=peek(mo+36)
  139.    1851 ifpeek(mo+45)<192then1842
  140.    1852 sysmo+15:ifpeek(mo+45)>191then1852
  141.    1856 gosub200:goto1862:rem brancher subroutine
  142.    1858 goto1842
  143.    1862 program continues after button press
  144.  
  145.  SYSMO+9 shows the mouse, then SYSMO+15 tracks the mouse pointer.  Line
  146. 1850 gives you the x and y coordinates of the pointer when the SYSMO+15
  147. command was last encountered.  Lines 1851 and 1852 were suggested by
  148. Maurice Randall to allow for slow mouses or heavy-handed button pushers.
  149. Line 1856 checks to see if the left button was pressed, and if so, takes
  150. you to the Brancher subroutine at 200.
  151.  
  152.  Lines 200-226: The Brancher - This subroutine will take the x and y
  153. coordinates of the mouse pointer (xm and ym) and give you the number of the
  154. button pointed to (ft).  In KLONDIKE JONES there are 26 possible buttons.
  155. If the pointer is not on a button, then ft=-1.
  156.  
  157.  It's a good idea to always hide the mouse before anything is drawn on the
  158. screen.  Technically, this is only necessary when something is being
  159. printed in the area where the mouse pointer is, but how can you know where
  160. the mouse will be?  Just to be safe put SYSMO+6 before ANY command that
  161. changes the screen and SYSMO+9 after, to turn the pointer back on.
  162.  
  163.     Jon Mattson's CARD command makes displaying cards easy but you have to
  164. be careful about printing a card so low on the screen that it extends past
  165. the bottom of the screen.  Generally the card will "wraparound" and the
  166. bottom of the card will show up at the top of the screen.  In KLONDIKE
  167. JONES if you have a tableau pile that extends from King down to Deuce, the
  168. bottom part of the deuce card will wrap around to the top row.  Since the
  169. program automatically redraws the option line at the top of the screen, you
  170. never see this blip.  Be careful in your program not to allow the program
  171. to print below the bott